package junior;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class B {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Integer> integers = new ArrayList<>();
        int N = scanner.nextInt();
        for (int i = 0; i < N; i++)
            integers.add(scanner.nextInt());

        int[] aa = new int[]{6,9,6,6,1,1,1};

//        System.out.println("S(aa) = " + S(aa));
    }

    public class ListNode{
        int val;
        ListNode next;

        public ListNode(int val, ListNode next) {
            this.val = val;
            this.next = next;
        }
    }
    public static ListNode S(ListNode link, int n){
        ListNode result;
        int len = 1;
        ListNode tail = null;
        ListNode p = link;
        if(p.next != null){
            len++;
            tail = p;
            p = p.next;
        }
        int nT = len % n;
        tail.next = link;
        p = link;
        for (int i = 1; i < len - nT - 1; i++) {
            p = p.next;
        }
        result = p.next;
        p.next = null;
        return result;
    }

}
